package com.qf.controller;

import com.qf.domain.User;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

//@Controller
@RestController
@RequestMapping("/json")
public class JsonController {
    @GetMapping("/testGet")
    public User testGet(){
        User user = new User();
        user.setId(3);
        user.setUsername("朱玲");
        user.setSex("男");
        user.setBirthday(new Date());
        return user;
    }

    @PostMapping("/testPost")
    public String  testPost(@RequestBody User user){
        System.out.println(user);
        return "success";
    }
}
